Skip to content

Conversation

@YunchuWang
Copy link
Member

@YunchuWang YunchuWang commented Jan 26, 2025

Schedule Support for Durable Task Framework
Overview
This PR introduces comprehensive scheduling capabilities to the Durable Task Framework, enabling users to create and manage recurring task executions with fine-grained control over timing and execution parameters.
Key Features

  1. Schedule Management
    Create, pause, resume, update, and delete scheduled tasks
    Flexible schedule configuration with support for:
    Custom intervals (minimum 1 second)
    Start and end times
    Immediate or delayed first execution
    Custom orchestration instance IDs
    Orchestration input parameters
  2. Schedule Configuration
    ScheduleCreationOptions for initial setup with required parameters:
    scheduleId: Unique identifier for the schedule
    orchestrationName: Target orchestration to execute
    interval: Time between executions
    Optional parameters:
    startAt: Custom start time
    endAt: Schedule termination time
    orchestrationInput: Input data for the orchestration
    orchestrationInstanceId: Custom instance ID
    startImmediatelyIfLate: Controls immediate execution behavior
  3. Schedule State Management
    Robust state transitions with validation
    Schedule status tracking (Active, Paused, etc.)
    Execution history tracking:
    Last run time
    Next scheduled run time
    Execution token for operation validation
  4. Client Interface
    Clean and intuitive client API through ScheduledTaskClient
    Async operations for all schedule management functions
    Comprehensive error handling and logging
    Support for cancellation tokens
  5. Worker Integration
    Simple worker configuration through extension methods
    Automatic registration of required components:
    Schedule entity
    Schedule operation orchestrator

@YunchuWang YunchuWang changed the title Wangbill/update sln DTS Schedule POC Jan 26, 2025
@YunchuWang YunchuWang changed the title DTS Schedule POC DTS Schedule POC Draft Jan 26, 2025
@YunchuWang YunchuWang requested a review from nytian February 26, 2025 20:41
@YunchuWang
Copy link
Member Author

fyi branch for e2e tests https://github.com/microsoft/durabletask-dotnet/tree/wangbill/schedule-e2e-tests. i added 32 testcases all passing
image

Copy link
Member

@sebastianburckhardt sebastianburckhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

(I did not review the tests)

@YunchuWang YunchuWang dismissed jviau’s stale review February 28, 2025 18:30

changes are updated based on feedback, thanks

Copy link
Member

@cgillum cgillum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments. I'm particularly concerned about the possibility of null-ref exceptions in the Schedule.cs code. We're overriding the nullable reference types checks in ways that seem to open the door for lots of null-ref exceptions.

@YunchuWang YunchuWang requested a review from cgillum March 3, 2025 07:27
@YunchuWang YunchuWang merged commit cb79861 into main Mar 3, 2025
4 checks passed
@YunchuWang YunchuWang deleted the wangbill/update-sln branch March 3, 2025 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants